<?php
if (!defined('IN_XLP')) {
    exit('Access Denied');
}
$Document = array(
    'pageid' => 'login-index', //页面标示
    'pagename' => '登陆', //当前页面名称
    'mycss' => array('mobile/style'), //加载的css样式表
    'myjs' => array('global/jquery-1.9.0.min','global/layer/layer'), //加载的js脚本
    'footerjs'=>array(),
    'head'=>true//是否加载头部文件
);
include getTpl('header', 'public');
?>
<body>
<div class="content">
    <div class="logo">
        <img src="<?php echo IMG_PATH ?>mobile/logo.png"/>
    </div>
    <div class="login_wr">
        <form id="loginForm">
            <div class="infor_box key">
                <div class="account">
                    <input type="text" name="phone" placeholder="手机号">
                    <b>
                        <svg t="1535421301469" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2988" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="25"><path d="M512 533.333333c132.266667 0 243.2-110.933333 243.2-247.466666S644.266667 42.666667 512 42.666667 268.8 153.6 268.8 285.866667s110.933333 247.466667 243.2 247.466666z m0-413.866666c89.6 0 166.4 76.8 166.4 170.666666s-72.533333 170.666667-166.4 170.666667-166.4-76.8-166.4-170.666667 76.8-170.666667 166.4-170.666666zM712.533333 580.266667c-29.866667-17.066667-68.266667-12.8-93.866666 8.533333-21.333333 17.066667-55.466667 42.666667-102.4 42.666667-38.4 0-72.533333-12.8-110.933334-42.666667-25.6-21.333333-59.733333-25.6-89.6-8.533333-93.866667 46.933333-217.6 132.266667-217.6 324.266666 0 42.666667 38.4 81.066667 81.066667 81.066667h657.066667c42.666667 0 81.066667-38.4 81.066666-81.066667 4.266667-179.2-102.4-264.533333-204.8-324.266666z m128 324.266666H183.466667c-4.266667 0-4.266667-4.266667-4.266667-4.266666 0-145.066667 89.6-209.066667 174.933333-256h8.533334c51.2 38.4 102.4 59.733333 157.866666 59.733333 72.533333 0 123.733333-34.133333 153.6-59.733333h4.266667c102.4 59.733333 170.666667 128 170.666667 256-4.266667 4.266667-4.266667 4.266667-8.533334 4.266666z" p-id="2989"></path></svg>
                    </b>
                </div>
                <div class="password">
                    <input type="password" name="password" placeholder="密码">
                    <b>
                        <svg t="1535421398352" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4198" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="25"><path d="M850.5 409.6l0-68.3C850.5 152.8 698.9 0 512 0 325.1 0 173.5 152.8 173.5 341.3l0 68.3L76.8 409.6l0 468.1c0 80.8 64.9 146.3 145.1 146.3l580.3 0c80.1 0 145.1-65.5 145.1-146.3L947.3 409.6 850.5 409.6zM256 349.9c0-150.8 116.2-273.1 259.5-273.1 153.6 0 252.5 131 252.5 292.6l0 40.2L256 409.6 256 349.9zM870.4 811.7c0 107.9-26.4 135.5-128 135.5L281.6 947.2c-102 0-128-27.2-128-135.5L153.6 486.4l716.8 0L870.4 811.7z" p-id="4199"></path><path d="M512 819.2c28.3 0 51.2-22.9 51.2-51.2L563.2 665.6c0-28.3-22.9-51.2-51.2-51.2-28.3 0-51.2 22.9-51.2 51.2L460.8 768C460.8 796.3 483.7 819.2 512 819.2z" p-id="4200"></path></svg>
                    </b>
                </div>
            </div>
        </form>
        <div class="forget">
            <!-- 忘记密码？ -->
        </div>
        <button class="l_btn blue" id="loginBtn">登录</button>
        <a href="<?php echo U('login/register') ?>"><button class="l_btn">注册</button></a>
    </div>
</div>
<script type="text/javascript">
    $(function(){
        //用户登录
        $("#loginBtn").click(function(){
            $(this).attr('disabled' , true);
            var loginUrl = "<?php echo U('login/ajaxLogin') ?>";
            $.post(loginUrl , $("#loginForm").serialize(), function(result){
                if(result.status){
                    layer.msg(result.info);
                    setTimeout(function () {
                      window.location.href = result.data;
                    }, 2000);
                }else{
                    layer.msg(result.info);
                    $("#loginBtn").attr('disabled' , false);
                    return false;
                }
            },'json');
        });
    });
</script>
</body>
</html>